<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <!-- 定义 Commons-Validator Factory
         注意:当前版本的springmodules, validatorFactory不能定义在bookstore-servlet-->
    <bean id="validatorFactory" class="org.springmodules.validation.commons.DefaultValidatorFactory">
        <property name="validationConfigLocations">
            <list>
                <value>file:${oa_application.config}/validator-rules.xml</value>
                <value>file:${oa_application.config}/validator.xml</value>
                <!-- 下面文件用于项目的扩展，标准版保持此文件为空 -->
                <value>file:${oa_application.config}/extend/validator.xml</value>
            </list>
        </property>
    </bean>

    <!-- 用"validators"作id,方便autowire到 web controllers -->
    <bean id="validators" class="org.springmodules.validation.commons.DefaultBeanValidator">
        <property name="validatorFactory">
        	<ref local="validatorFactory"/>
        </property>
    </bean>
</beans>
